Power-user — Intune package
===========================

This zip is an IT kit to configure Power-user as a Win32 app in Microsoft Intune.

Download the latest kit from:

  https://powerusersoftware.com/download/Power-user.zip

If you need help with the Intune rollout, contact: support@powerusersoftware.com


Package contents
----------------

1. Readme.txt
  This file.

2. Power-user.intunewin
  Pre-built Win32 app package. Prefer this file for Intune upload, unless 
  you need to customize the scripts.

3. Description.txt
  Suggested application description for the Intune Win32 app properties.

4. Logo.png
  Suggested logo for the Intune Win32 app properties.

5. Detection rule.ps1
  Custom detection script to upload in Intune (Detection rules).
  Must run in USER context. Exit 0 = installed and up to date,
  Exit 1 = not installed or older version (triggers install/upgrade).
  Checks that Power-user is present, registered, and recent enough.
  Re-upload this script in Intune whenever you publish a new Win32 app version.

intunewin_source\
  Source folder to rebuild Power-user.intunewin with Microsoft Win32 Content
  Prep Tool (IntuneWinAppUtil.exe), if you need to customize the scripts.
  Contents:

  intunewin_source\Power-user.msi
    Power-user installer (per-user under %LOCALAPPDATA%\Power-user).

  intunewin_source\install.ps1
    Install script (USER context): installs the MSI, optionally activates the license.

  intunewin_source\uninstall.ps1
    Uninstall script (USER context): optionally deactivates the license,
    then removes Power-user via Windows Installer.

  intunewin_source\logging.ps1
    Shared logging helper used by install.ps1 and uninstall.ps1.


Configure in Intune
-------------------

Follow the step-by-step guide in our knowledge base:

  https://support.powerusersoftware.com/support/solutions/articles/80001038386-rolling-out-power-user-with-intune

Suggested Install / Uninstall commands (USER context):

  powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\install.ps1 -LicenseKey "YOUR-LICENSE-KEY"
  powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\uninstall.ps1 -LicenseKey "YOUR-LICENSE-KEY"

If your organization requires signed scripts only:

  powershell.exe -NoProfile -ExecutionPolicy AllSigned -File .\install.ps1 -LicenseKey "YOUR-LICENSE-KEY"
  powershell.exe -NoProfile -ExecutionPolicy AllSigned -File .\uninstall.ps1 -LicenseKey "YOUR-LICENSE-KEY"

  The scripts in this package are signed; the Power-user signing certificate must
  be trusted on the device.


Logs (for troubleshooting)
--------------------------

Scripts and msiexec write logs under:

  %LOCALAPPDATA%\Temp\Power-user\

  Log_Rollout.txt           — install/uninstall script steps
  Log_Rollout_Install.txt   — verbose msiexec log for MSI install
  Log_Rollout_Uninstall.txt — verbose msiexec log for MSI uninstall
  Log_Rollout_DetectionRule.txt — last Intune detection script run

The folder is created automatically if it does not exist.
If rollout fails, send these files to support@powerusersoftware.com.


Power-user.intunewin
------------------

We recommend using the pre-built "2. Power-user.intunewin" included in this zip

Rebuild Power-user.intunewin from intunewin_source\ only if the default install /
uninstall scripts are not sufficient for your use case (see below).


How to rebuild Power-user.intunewin (optional)
---------------------------------------------

Only needed when you modify the default scripts for your environment.

1. Install the Microsoft Win32 Content Prep Tool (IntuneWinAppUtil.exe), for example:
   https://github.com/microsoft/Microsoft-Win32-Content-Prep-Tool

2. Edit install.ps1 and/or uninstall.ps1 inside intunewin_source\
   (license handling, logging, etc.). Keep Power-user.msi in the same folder
   as the scripts. Editing a script breaks its Authenticode signature — use
   -ExecutionPolicy Bypass for the customized package is mandatory.

3. Open a command prompt and run:

   IntuneWinAppUtil.exe -c "<path\to\intunewin_source>" -s "Power-user.msi" -o "<path\to\output_folder>" -q

   -c  Source folder (intunewin_source)
   -s  Setup file name inside that folder (Power-user.msi)
   -o  Folder where Power-user.intunewin will be created
   -q  Quiet mode

4. Upload the generated Power-user.intunewin to your Intune Win32 app.
